var inputs = document.querySelectorAll('input');
var loginBtn = document.querySelector('button');
loginBtn.onclick = () => {
    axios.post('/user/login', {
        phone: inputs[0].value,
        pass: inputs[1].value
    }).then((res) => {
        if (res.data.code == 200) {
            localStorage.setItem('userinfo', JSON.stringify(res.data.userinfo));
            alert('登陆成功!');
            location.href = './index.html';
        } else {
            alert('登陆失败!')

        }
    })
}